package com.loanpcase;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONPObject;
import com.util.GzipUtil;

import java.io.File;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;

public class RLDJ0008 extends LPCase{


	@Override
	protected String getRequestUrl() {
		return "/RLMS/RLDJ0008";
	}

	public Map<String,Object> getRequestData(){
		HashMap<String,Object> REQUESTDATA = new HashMap<String, Object>();
		REQUESTDATA.put("DOCKING_ORGNO","00033");
		REQUESTDATA.put("COOPER_CODE","90001");
		REQUESTDATA.put("STARTDATE","20220824");
		REQUESTDATA.put("ENDDATE","20220824");
		REQUESTDATA.put("DATATYPE","001");
		return REQUESTDATA;
		
	}

	static public void main(String[] args){

		//new RLDJ0008().run("http://127.0.0.1:18082/loanproxy");
		//new RLDJ0008().run(Config.TEST_CONTEXT_URL_1601);
		System.out.println("RL00033900012022080600PG.rlpg".substring(12, 20));
	}

	@Override
	protected void handleResult(String result) throws UnsupportedEncodingException {
		System.out.println(result);
		JSONObject rej = JSONObject.parseObject(result);
		JSONObject RESULTOBJECT = (JSONObject) rej.get("RESULTOBJECT");
		//System.out.println(map.get("RESULTOBJECT"));
		String data = GzipUtil.ungzipString(RESULTOBJECT.get("ITEMS").toString());
		System.out.println(data);
		//System.out.println(GzipUtil.ungzipString(GzipUtil.gzipString("[{\"appgDate\":\"20220824\",\"applyNo\":\"900010001PLAA2018071218050200116\",\"benchmarkRate\":0,\"cooperCode\":\"90001\",\"dockingOrgno\":\"00033\",\"lastModDt\":\"20220824\",\"lastModTm\":\"140037\",\"lastModUserId\":\"ADMIN\",\"loanAmount\":0,\"loanPeriod\":0,\"loanPrdcode\":\"PLAB\",\"rateRatio\":0,\"rateValue\":0,\"taskSeqno\":\"200100491082\",\"taskStatus\":\"0100\"},{\"appgDate\":\"20220824\",\"applyNo\":\"3d328e3fc6cb480291c07683c78ed3c7\",\"benchmarkRate\":0,\"cooperCode\":\"90001\",\"dockingOrgno\":\"00033\",\"lastModDt\":\"20220824\",\"lastModTm\":\"103915\",\"lastModUserId\":\"ADMIN\",\"loanAmount\":0,\"loanPeriod\":0,\"loanPrdcode\":\"PLAA\",\"rateRatio\":0,\"rateValue\":0,\"taskSeqno\":\"200100491057\",\"taskStatus\":\"0100\"},{\"appgDate\":\"20220824\",\"applyNo\":\"819a938d17e547b097020631150662b4\",\"benchmarkRate\":0,\"cooperCode\":\"90001\",\"dockingOrgno\":\"00033\",\"lastModDt\":\"20220824\",\"lastModTm\":\"103534\",\"lastModUserId\":\"ADMIN\",\"loanAmount\":0,\"loanPeriod\":0,\"loanPrdcode\":\"PLAA\",\"rateRatio\":0,\"rateValue\":0,\"taskSeqno\":\"200100491052\",\"taskStatus\":\"0100\"}]")));
	};


	


}
